package com.design.pattern.factory;

public abstract class PizzaStore {

    public Pizza orderPizza(String type) {
        Pizza pizza = createPizza(type);
        if (pizza == null) {
            System.out.println("没有这种披萨，换一家吧");
            return null;
        }
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.bake();
        return pizza;
    }

    public abstract Pizza createPizza(String type);

}